<!--选择实训模块-->
<div class="container-fluid" id="selectpractice">
  <div class="page-header">
    <div class="pull-left">
      <h4>选择实训</h4>
    </div>
  </div>
  <!--名额限制型实训选择-->
  <div class="page-title">
    <div class="pull-left">
      <a>名额限制型实训选择</a>
    </div>
    <div class="pull-right">
      <span style="color:red;margin-left:20px;">截至日期:2017.02.10</span>
    </div>
  </div>
  <table class="table table-hover table-bordered ">
    <thead>
      <tr>
        <th class="col-xs-1">编号</th>
        <th class="col-xs-6">内容</th>
        <th class="col-xs-2">地点</th>
        <th class="col-xs-1">类型</th>
        <th class="col-xs-1">剩余名额</th>
        <th class="col-xs-1">选择</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td scope="row">2017011586</td>
        <td>湖南芒果TV实训</td>
        <td>长沙</td>
        <td>校外实训</td>
        <td>23</td>
        <td>
          <span class="btn-sm btn-info" data-toggle="modal" data-target="#myModal" onclick="setSelectPracticeId(192)">选择</span>
        </td>
      </tr>
      <tr>
        <td scope="row">2017015616</td>
        <td>昆明长水机场现无人机扰航多航班备降 或被罚10万</td>
        <td>长沙</td>
        <td>校外实训</td>
        <td>23</td>
        <td>
          <span class="btn-sm btn-info" data-toggle="modal" data-target="#myModal" onclick="setSelectPracticeId(192)">选择</span>
        </td>
      </tr>
      <tr>
        <td scope="row">2017015613</td>
        <td>湖南芒果TV实训</td>
        <td>长沙</td>
        <td>校外实训</td>
        <td>23</td>
        <td>
          <span class="btn-sm btn-info" data-toggle="modal" data-target="#myModal" onclick="setSelectPracticeId(192)">选择</span>
        </td>
      </tr>
    </tbody>
  </table>
  <!--优先级排序后台分配型实训选择-->
  <div class="page-title" style="margin-top: 50px;">
    <div class="pull-left">
      <a>优先级排序后台分配型实训选择</a>
    </div>
    <div class="pull-right">
    <small style="color: red;margin-left:20px;">数字越小优先级越高</small>
    </div>
  </div>
  <table class="table table-hover table-bordered ">
    <thead>
      <tr>
        <th class="col-xs-1">编号</th>
        <th class="col-xs-6">内容</th>
        <th class="col-xs-2">地点</th>
        <th class="col-xs-1">类型</th>
        <th class="col-xs-2">优先级</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td scope="row">2017011586</td>
        <td>湖南芒果TV实训</td>
        <td>长沙</td>
        <td>校外实训</td>
        <td>
          <select class="form-control">
            <option>1</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
          </select>
        </td>
      </tr>
      <tr>
        <td scope="row">2017015616</td>
        <td>昆明长水机场现无人机扰航多航班备降 或被罚10万</td>
        <td>长沙</td>
        <td>校外实训</td>
        <td>
          <select class="form-control">
            <option>1</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
          </select>
        </td>
      </tr>
      <tr>
        <td scope="row">2017015613</td>
        <td>湖南芒果TV实训</td>
        <td>长沙</td>
        <td>校外实训</td>
        <td>
          <select class="form-control">
            <option>1</option>
            <option>2</option>
            <option>3</option>
            <option>4</option>
            <option>5</option>
          </select>
        </td>
      </tr>
    </tbody>
  </table>
</div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="z-index:1050;">
  <div class="modal-dialog" role="document" style="margin-top: 300px;">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">通知</h4>
      </div>
      <div class="modal-body">
        是否确认选择实训课题
      </div>
      <div class="modal-footer">
        <span type="button" class="btn btn-primary" data-dismiss="modal" onclick="selectPractice()">确定</span>
        <span type="button" class="btn btn-default" data-dismiss="modal">关闭</span>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  var selectedPracticeId;

  /**
   * 选择实训课题
   */
  function selectPractice() {
    console.log("into selectPractice");
    $.ajax({
      url: 'resource/tmp/success',
      success: function (data) {
        if (data == 'success') {
          //选择成功
          $.notify("选择实训课题成功，请前往个人信息查证!", {
            position: 'top center',
            className: 'success'
          });
        } else {
          //选择失败
          $.notify("选择实训课题失败，请前重新选择!", {
            position: 'top center',
            className: 'error'
          });
        }
      },
      error: function (data) {
        //选择失败
        $.notify("选择实训课题失败，请前重新选择!", {
          position: 'top center',
          className: 'error'
        });
      }
    })
  }

  function setSelectPracticeId(id) {
    selectedPracticeId = id;
    console.log(id);
  }

</script>